using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Week1.helper
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class DefaultEffect
    {
        public Texture2D Texture
        {
            set { oEffect.Parameters["Texture"].SetValue(value); }
        }
        
        public bool TextureEnabled;

        public Matrix Projection
        {
            set { oEffect.Parameters["Projection"].SetValue(value); }
        }

        public Matrix View
        {
            set { oEffect.Parameters["View"].SetValue(value); }
        }

        public Matrix World
        {
            set { oEffect.Parameters["World"].SetValue(value); }
        }

        public EffectTechnique CurrentTechnique;
        protected Game oGame;
        protected Effect oEffect;


        public DefaultEffect(Game game)
            : base()
        {
            oGame = game;
            loadContent();
        }
        /// <summary>
        /// Must call this method from loadContent of game component. This method loads the underlying effect file.
        /// </summary>
        protected void loadContent()
        {
            oEffect = oGame.Content.Load<Effect>("Default2D");
            CurrentTechnique = oEffect.CurrentTechnique;
        }

    }
}
